package com.scraper.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="region")
public class Region implements Serializable{

	private static final long serialVersionUID = -889035363790447213L;
	
	private Integer id;
	private String name;
	private City city;
	private List<SaleObject> saleObjects = new ArrayList<SaleObject>();
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column
	public Integer getId() {
		return id;
	}
	
	@Column
	public String getName() {
		return name;
	}
	
	@ManyToOne
	public City getCity() {
		return city;
	}
	
	@OneToMany
	public List<SaleObject> getSaleObjects() {
		return saleObjects;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public void setCity(City city) {
		this.city = city;
	}

	public void setSaleObjects(List<SaleObject> saleObjects) {
		this.saleObjects = saleObjects;
	}

}
